package com.util;

public class sql {
    /*
Navicat MySQL Data Transfer

Source Server         : aaa_copy
Source Server Version : 50610
Source Host           : localhost:3306
Source Database       : project

Target Server Type    : MYSQL
Target Server Version : 50610
File Encoding         : 65001

Date: 2021-06-27 18:37:46
*/
/*
    SET FOREIGN_KEY_CHECKS=0;

-- ----------------------------
        -- Table structure for activity
-- ----------------------------
    DROP TABLE IF EXISTS `activity`;
    CREATE TABLE `activity` (
            `aid` int(11) NOT NULL AUTO_INCREMENT COMMENT '活动编号',
            `datails` varchar(100) NOT NULL COMMENT '活动详情',
            `money` double(10,2) NOT NULL COMMENT '金额',
            `gift` varchar(255) DEFAULT NULL COMMENT '礼品',
            `state` int(11) DEFAULT '0' COMMENT '状态',
    PRIMARY KEY (`aid`),
    KEY `fk_cid` (`gift`)
            ) ENGINE=InnoDB DEFAULT CHARSET=utf8;

-- ----------------------------
        -- Records of activity
-- ----------------------------

        -- ----------------------------
        -- Table structure for agreer
-- ----------------------------
    DROP TABLE IF EXISTS `agreer`;
    CREATE TABLE `agreer` (
            `agrid` int(11) NOT NULL AUTO_INCREMENT COMMENT '审批人记录编号',
            `iid` int(11) NOT NULL COMMENT '订单编号',
            `appno` int(11) NOT NULL COMMENT '审批人编号',
    PRIMARY KEY (`agrid`),
    KEY `fk_employee_appno` (`appno`),
    KEY `fk_indent_iid` (`iid`),
    CONSTRAINT `fk_employee_appno` FOREIGN KEY (`appno`) REFERENCES `employee` (`empno`),
    CONSTRAINT `fk_indent_iid` FOREIGN KEY (`iid`) REFERENCES `indent` (`iid`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=27 DEFAULT CHARSET=utf8 ROW_FORMAT=COMPACT;

-- ----------------------------
        -- Records of agreer
-- ----------------------------
    INSERT INTO `agreer` VALUES ('1', '1', '1');
    INSERT INTO `agreer` VALUES ('2', '1', '1');
    INSERT INTO `agreer` VALUES ('3', '2', '1');
    INSERT INTO `agreer` VALUES ('4', '2', '1');
    INSERT INTO `agreer` VALUES ('5', '4', '1');
    INSERT INTO `agreer` VALUES ('6', '4', '1');
    INSERT INTO `agreer` VALUES ('7', '5', '1');
    INSERT INTO `agreer` VALUES ('8', '5', '1');
    INSERT INTO `agreer` VALUES ('9', '6', '1');
    INSERT INTO `agreer` VALUES ('10', '6', '1');
    INSERT INTO `agreer` VALUES ('11', '7', '1');
    INSERT INTO `agreer` VALUES ('12', '7', '1');
    INSERT INTO `agreer` VALUES ('13', '8', '1');
    INSERT INTO `agreer` VALUES ('14', '8', '1');
    INSERT INTO `agreer` VALUES ('15', '9', '1');
    INSERT INTO `agreer` VALUES ('16', '9', '1');
    INSERT INTO `agreer` VALUES ('17', '10', '1');
    INSERT INTO `agreer` VALUES ('18', '10', '1');
    INSERT INTO `agreer` VALUES ('19', '11', '1');
    INSERT INTO `agreer` VALUES ('20', '11', '1');
    INSERT INTO `agreer` VALUES ('21', '12', '1');
    INSERT INTO `agreer` VALUES ('22', '12', '1');
    INSERT INTO `agreer` VALUES ('23', '13', '1');
    INSERT INTO `agreer` VALUES ('24', '13', '1');
    INSERT INTO `agreer` VALUES ('25', '14', '1');
    INSERT INTO `agreer` VALUES ('26', '14', '1');

-- ----------------------------
        -- Table structure for checkout
-- ----------------------------
    DROP TABLE IF EXISTS `checkout`;
    CREATE TABLE `checkout` (
            `cid` int(11) NOT NULL COMMENT '库存编号',
            `quantity` double(11,2) NOT NULL COMMENT '购买数量'
            ) ENGINE=InnoDB DEFAULT CHARSET=utf8;

-- ----------------------------
        -- Records of checkout
-- ----------------------------

        -- ----------------------------
        -- Table structure for classify
-- ----------------------------
    DROP TABLE IF EXISTS `classify`;
    CREATE TABLE `classify` (
            `tid` int(11) NOT NULL COMMENT '类别编号',
            `tname` varchar(225) DEFAULT NULL COMMENT '类别名称',
    PRIMARY KEY (`tid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

-- ----------------------------
        -- Records of classify
-- ----------------------------
    INSERT INTO `classify` VALUES ('1', '食品类');
    INSERT INTO `classify` VALUES ('2', '日用品类');
    INSERT INTO `classify` VALUES ('3', '百货类');
    INSERT INTO `classify` VALUES ('4', '饮料类');

-- ----------------------------
        -- Table structure for commodity
-- ----------------------------
    DROP TABLE IF EXISTS `commodity`;
    CREATE TABLE `commodity` (
            `cid` int(11) NOT NULL AUTO_INCREMENT COMMENT '商品编号',
            `cname` varchar(20) NOT NULL COMMENT '商品名称',
            `tid` int(11) NOT NULL COMMENT '商品类型',
            `cprice` decimal(11,2) NOT NULL COMMENT '价格',
            `sprice` decimal(11,2) DEFAULT NULL COMMENT '售价',
            `mid` int(11) NOT NULL COMMENT '计量单位',
            `count` int(11) NOT NULL COMMENT '数量',
            `sid` int(11) DEFAULT NULL COMMENT '供应商',
            `judge` int(11) NOT NULL DEFAULT '0' COMMENT '0货源充足,1货源不足已发送订单',
    PRIMARY KEY (`cid`),
    KEY `fk_mea_mid` (`mid`),
    KEY `fk_suppiler` (`sid`),
    KEY `fk_classify_cfyid` (`tid`),
    CONSTRAINT `fk_classify_cfyid` FOREIGN KEY (`tid`) REFERENCES `classify` (`tid`),
    CONSTRAINT `fk_mea_mid` FOREIGN KEY (`mid`) REFERENCES `measurement` (`mid`) ON DELETE CASCADE ON UPDATE CASCADE,
    CONSTRAINT `fk_suppiler` FOREIGN KEY (`sid`) REFERENCES `suppiler` (`sid`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=9 DEFAULT CHARSET=utf8;

-- ----------------------------
        -- Records of commodity
-- ----------------------------
    INSERT INTO `commodity` VALUES ('1', '可口可乐', '4', '46.80', '4.00', '7', '1589', '1', '0');
    INSERT INTO `commodity` VALUES ('2', '花生牛轧糖', '1', '9.50', '0.50', '9', '199', '1', '0');
    INSERT INTO `commodity` VALUES ('3', '名创冰泉', '4', '30.00', '4.00', '10', '199', '1', '0');
    INSERT INTO `commodity` VALUES ('4', '纳诺儿童牙膏牙刷套装', '2', '3.90', '5.00', '11', '1994', '1', '0');
    INSERT INTO `commodity` VALUES ('5', '刮刮乐拖把', '3', '18.00', '19.98', '12', '159', '1', '0');
    INSERT INTO `commodity` VALUES ('6', '方便面', '1', '20.00', '3.00', '13', '298', '1', '0');
    INSERT INTO `commodity` VALUES ('7', '老坛酸菜牛肉面', '1', '40.00', '5.00', '14', '99', '1', '0');
    INSERT INTO `commodity` VALUES ('8', '巧克力', '1', '30.00', '3.00', '15', '99', '1', '0');

-- ----------------------------
        -- Table structure for commoditylog4j
-- ----------------------------
    DROP TABLE IF EXISTS `commoditylog4j`;
    CREATE TABLE `commoditylog4j` (
            `logid` int(11) NOT NULL AUTO_INCREMENT COMMENT '销售记录编号',
            `cid` int(11) NOT NULL COMMENT '商品编号',
            `price` decimal(65,0) NOT NULL COMMENT '单价',
            `sprice` decimal(65,2) NOT NULL COMMENT '售价',
            `count` double(11,2) NOT NULL COMMENT '数量',
            `mlittle` varchar(255) NOT NULL COMMENT '单位',
            `hiredate` date NOT NULL COMMENT '记录时间',
            `state` int(11) NOT NULL DEFAULT '0' COMMENT '0售出，1退货',
    PRIMARY KEY (`logid`),
    KEY `fk_cid_commodity` (`cid`)
            ) ENGINE=InnoDB AUTO_INCREMENT=22 DEFAULT CHARSET=utf8;

-- ----------------------------
        -- Records of commoditylog4j
-- ----------------------------
    INSERT INTO `commoditylog4j` VALUES ('6', '1', '47', '4.00', '2.00', '瓶', '2021-06-16', '0');
    INSERT INTO `commoditylog4j` VALUES ('7', '1', '47', '4.00', '3.00', '瓶', '2021-06-16', '0');
    INSERT INTO `commoditylog4j` VALUES ('8', '1', '47', '4.00', '1.00', '瓶', '2021-06-16', '0');
    INSERT INTO `commoditylog4j` VALUES ('9', '1', '47', '4.00', '2.00', '瓶', '2021-06-16', '0');
    INSERT INTO `commoditylog4j` VALUES ('10', '1', '47', '4.00', '50.00', '瓶', '2021-06-16', '0');
    INSERT INTO `commoditylog4j` VALUES ('11', '1', '47', '4.00', '12.00', '瓶', '2021-06-16', '0');
    INSERT INTO `commoditylog4j` VALUES ('12', '1', '47', '4.00', '1.00', '瓶', '2021-06-16', '1');
    INSERT INTO `commoditylog4j` VALUES ('13', '1', '47', '4.00', '2.00', '瓶', '2021-06-17', '0');
    INSERT INTO `commoditylog4j` VALUES ('14', '3', '30', '4.00', '11.00', '瓶', '2021-06-17', '0');
    INSERT INTO `commoditylog4j` VALUES ('15', '2', '10', '0.50', '500.00', 'g', '2021-06-16', '0');
    INSERT INTO `commoditylog4j` VALUES ('16', '4', '4', '5.00', '1.00', '盒', '2021-06-18', '0');
    INSERT INTO `commoditylog4j` VALUES ('17', '5', '18', '19.98', '1.00', '件', '2021-06-18', '0');
    INSERT INTO `commoditylog4j` VALUES ('18', '4', '4', '5.00', '5.00', '盒', '2021-06-18', '0');
    INSERT INTO `commoditylog4j` VALUES ('19', '6', '20', '3.00', '30.00', '包', '2021-06-18', '0');
    INSERT INTO `commoditylog4j` VALUES ('20', '1', '47', '4.00', '1.00', '瓶', '2021-06-18', '1');
    INSERT INTO `commoditylog4j` VALUES ('21', '6', '20', '3.00', '2.00', '包', '2021-06-18', '0');

-- ----------------------------
        -- Table structure for c_emp_role
-- ----------------------------
    DROP TABLE IF EXISTS `c_emp_role`;
    CREATE TABLE `c_emp_role` (
            `cerid` int(255) NOT NULL AUTO_INCREMENT,
  `empid` int(255) DEFAULT NULL,
  `roleid` int(255) DEFAULT NULL,
    PRIMARY KEY (`cerid`),
    KEY `empid` (`empid`),
    KEY `roleid` (`roleid`),
    CONSTRAINT `emp` FOREIGN KEY (`empid`) REFERENCES `employee` (`empno`) ON DELETE CASCADE ON UPDATE CASCADE,
    CONSTRAINT `role` FOREIGN KEY (`roleid`) REFERENCES `c_role` (`rid`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=13 DEFAULT CHARSET=utf8;

-- ----------------------------
        -- Records of c_emp_role
-- ----------------------------
    INSERT INTO `c_emp_role` VALUES ('1', '1', '1');
    INSERT INTO `c_emp_role` VALUES ('2', '2', '2');
    INSERT INTO `c_emp_role` VALUES ('3', '3', '5');
    INSERT INTO `c_emp_role` VALUES ('4', '4', '4');
    INSERT INTO `c_emp_role` VALUES ('11', '5', '7');
    INSERT INTO `c_emp_role` VALUES ('12', '6', '3');

-- ----------------------------
        -- Table structure for c_menu
-- ----------------------------
    DROP TABLE IF EXISTS `c_menu`;
    CREATE TABLE `c_menu` (
            `id` int(255) NOT NULL,
  `title` varchar(255) NOT NULL,
  `href` varchar(255) DEFAULT NULL,
  `pid` int(255) NOT NULL,
  `sort` int(255) NOT NULL,
  `remark` varchar(255) NOT NULL,
  `status` int(255) NOT NULL DEFAULT '1',
            `icon` varchar(255) DEFAULT NULL,
  `target` varchar(255) DEFAULT '_self',
    PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

-- ----------------------------
        -- Records of c_menu
-- ----------------------------
    INSERT INTO `c_menu` VALUES ('1', '常规管理', '', '0', '0', '常规管理', '1', 'fa fa-address-book', '_self');
    INSERT INTO `c_menu` VALUES ('2', '财务报表', 'page/welcome-2.jsp', '1', '2', '财务报表', '1', 'fa fa-line-chart', '_self');
    INSERT INTO `c_menu` VALUES ('3', '前台', null, '1', '1', '前台', '1', 'fa fa-desktop', '_self');
    INSERT INTO `c_menu` VALUES ('4', '收银', 'page/reception/reception.jsp', '3', '2', '收银', '1', 'fa fa-jpy', '_self');
    INSERT INTO `c_menu` VALUES ('5', '销售记录', 'page/reception/sellLog4j.jsp', '3', '2', '销售记录', '1', 'fa fa-book', '_self');
    INSERT INTO `c_menu` VALUES ('6', '商品', 'page/reception/sell.jsp', '1', '1', '商品', '1', 'fa fa-cart-arrow-down', '_self');
    INSERT INTO `c_menu` VALUES ('7', '订单管理', null, '1', '1', '订单管理', '1', 'fa fa-file-text-o', '_self');
    INSERT INTO `c_menu` VALUES ('8', '创建订单', 'page/indent/create.jsp', '7', '2', '创建订单', '1', 'fa fa-calendar-o', '_self');
    INSERT INTO `c_menu` VALUES ('9', '经理可审批', 'page/indent/managerIndent.jsp', '7', '2', '经理可审批', '1', 'fa fa-pencil-square-o', '_self');
    INSERT INTO `c_menu` VALUES ('10', '老板可审批', 'page/indent/bossIndent.jsp', '7', '2', '老板可审批', '1', 'fa fa-pencil-square-o', '_self');
    INSERT INTO `c_menu` VALUES ('11', '采购员可查看', 'page/indent/buyerIndent.jsp', '7', '2', '采购员可查看', '1', 'fa fa-pencil-square-o', '_self');
    INSERT INTO `c_menu` VALUES ('12', '财务审批', 'page/indent/financeindent.jsp', '7', '2', '财务审批', '1', 'fa fa-pencil-square-o', '_self');
    INSERT INTO `c_menu` VALUES ('13', '入库核对', 'page/indent/storage.jsp', '7', '2', '入库核对', '1', 'fa fa-pencil-square-o', '_self');
    INSERT INTO `c_menu` VALUES ('14', '库存', 'page/allcommodity.jsp', '1', '1', '库存', '1', 'fa fa-hourglass-end', '_self');
    INSERT INTO `c_menu` VALUES ('15', '供应商', 'page/suppiler/suppiler.jsp', '1', '1', '供应商', '1', 'fa fa-institution', '_self');
    INSERT INTO `c_menu` VALUES ('16', '员工管理', null, '1', '1', '员工管理', '1', 'fa fa-users', '_self');
    INSERT INTO `c_menu` VALUES ('17', '员工列表', 'page/emp/allemp.jsp', '16', '2', '员工列表', '1', 'fa fa-user', '_self');
    INSERT INTO `c_menu` VALUES ('18', '职位管理', 'page/allrole.jsp', '16', '2', '职位管理', '1', 'fa fa-user-secret', '_self');
    INSERT INTO `c_menu` VALUES ('19', '会员管理', 'page/vip/allvip.jsp', '1', '1', '会员管理', '1', 'fa fa-connectdevelop', '_self');
    INSERT INTO `c_menu` VALUES ('20', '订单记录', 'page/indent/allIndent.jsp', '7', '2', '订单记录', '1', 'fa fa-calendar', '_self');

-- ----------------------------
        -- Table structure for c_role
-- ----------------------------
    DROP TABLE IF EXISTS `c_role`;
    CREATE TABLE `c_role` (
            `rid` int(255) NOT NULL,
  `role` varchar(255) NOT NULL,
  `state` int(255) NOT NULL DEFAULT '1',
    PRIMARY KEY (`rid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

-- ----------------------------
        -- Records of c_role
-- ----------------------------
    INSERT INTO `c_role` VALUES ('1', '店长', '1');
    INSERT INTO `c_role` VALUES ('2', '采购经理', '1');
    INSERT INTO `c_role` VALUES ('3', '采购员', '1');
    INSERT INTO `c_role` VALUES ('4', '仓库管理员', '1');
    INSERT INTO `c_role` VALUES ('5', '销售经理', '1');
    INSERT INTO `c_role` VALUES ('6', '收银员', '1');
    INSERT INTO `c_role` VALUES ('7', '保管员', '1');
    INSERT INTO `c_role` VALUES ('8', '理货员', '1');
    INSERT INTO `c_role` VALUES ('9', '会计', '1');

-- ----------------------------
        -- Table structure for c_role_menu
-- ----------------------------
    DROP TABLE IF EXISTS `c_role_menu`;
    CREATE TABLE `c_role_menu` (
            `crmid` int(255) NOT NULL AUTO_INCREMENT,
  `roleid` int(255) NOT NULL DEFAULT '1',
            `menuid` int(255) NOT NULL,
    PRIMARY KEY (`crmid`),
    KEY `role1` (`roleid`),
    KEY `menu` (`menuid`),
    CONSTRAINT `menu` FOREIGN KEY (`menuid`) REFERENCES `c_menu` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
    CONSTRAINT `role1` FOREIGN KEY (`roleid`) REFERENCES `c_role` (`rid`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=56 DEFAULT CHARSET=utf8;

-- ----------------------------
        -- Records of c_role_menu
-- ----------------------------
    INSERT INTO `c_role_menu` VALUES ('1', '1', '1');
    INSERT INTO `c_role_menu` VALUES ('2', '1', '2');
    INSERT INTO `c_role_menu` VALUES ('3', '1', '3');
    INSERT INTO `c_role_menu` VALUES ('4', '1', '4');
    INSERT INTO `c_role_menu` VALUES ('5', '1', '5');
    INSERT INTO `c_role_menu` VALUES ('6', '1', '6');
    INSERT INTO `c_role_menu` VALUES ('7', '1', '7');
    INSERT INTO `c_role_menu` VALUES ('8', '1', '8');
    INSERT INTO `c_role_menu` VALUES ('9', '1', '9');
    INSERT INTO `c_role_menu` VALUES ('11', '1', '11');
    INSERT INTO `c_role_menu` VALUES ('12', '1', '12');
    INSERT INTO `c_role_menu` VALUES ('13', '1', '13');
    INSERT INTO `c_role_menu` VALUES ('14', '1', '14');
    INSERT INTO `c_role_menu` VALUES ('15', '1', '15');
    INSERT INTO `c_role_menu` VALUES ('16', '1', '16');
    INSERT INTO `c_role_menu` VALUES ('17', '1', '17');
    INSERT INTO `c_role_menu` VALUES ('18', '1', '18');
    INSERT INTO `c_role_menu` VALUES ('19', '1', '19');
    INSERT INTO `c_role_menu` VALUES ('20', '2', '1');
    INSERT INTO `c_role_menu` VALUES ('21', '2', '2');
    INSERT INTO `c_role_menu` VALUES ('22', '2', '3');
    INSERT INTO `c_role_menu` VALUES ('23', '2', '5');
    INSERT INTO `c_role_menu` VALUES ('24', '2', '7');
    INSERT INTO `c_role_menu` VALUES ('25', '2', '8');
    INSERT INTO `c_role_menu` VALUES ('26', '2', '14');
    INSERT INTO `c_role_menu` VALUES ('27', '2', '15');
    INSERT INTO `c_role_menu` VALUES ('28', '2', '16');
    INSERT INTO `c_role_menu` VALUES ('29', '2', '17');
    INSERT INTO `c_role_menu` VALUES ('30', '2', '19');
    INSERT INTO `c_role_menu` VALUES ('31', '3', '1');
    INSERT INTO `c_role_menu` VALUES ('32', '3', '7');
    INSERT INTO `c_role_menu` VALUES ('33', '3', '8');
    INSERT INTO `c_role_menu` VALUES ('34', '3', '11');
    INSERT INTO `c_role_menu` VALUES ('35', '4', '1');
    INSERT INTO `c_role_menu` VALUES ('36', '4', '14');
    INSERT INTO `c_role_menu` VALUES ('37', '5', '1');
    INSERT INTO `c_role_menu` VALUES ('38', '5', '2');
    INSERT INTO `c_role_menu` VALUES ('39', '5', '3');
    INSERT INTO `c_role_menu` VALUES ('40', '5', '5');
    INSERT INTO `c_role_menu` VALUES ('41', '5', '6');
    INSERT INTO `c_role_menu` VALUES ('42', '5', '19');
    INSERT INTO `c_role_menu` VALUES ('43', '6', '1');
    INSERT INTO `c_role_menu` VALUES ('44', '6', '3');
    INSERT INTO `c_role_menu` VALUES ('45', '6', '4');
    INSERT INTO `c_role_menu` VALUES ('46', '7', '1');
    INSERT INTO `c_role_menu` VALUES ('47', '7', '7');
    INSERT INTO `c_role_menu` VALUES ('48', '7', '13');
    INSERT INTO `c_role_menu` VALUES ('49', '9', '1');
    INSERT INTO `c_role_menu` VALUES ('50', '9', '2');
    INSERT INTO `c_role_menu` VALUES ('51', '9', '3');
    INSERT INTO `c_role_menu` VALUES ('52', '9', '5');
    INSERT INTO `c_role_menu` VALUES ('53', '9', '7');
    INSERT INTO `c_role_menu` VALUES ('54', '9', '12');
    INSERT INTO `c_role_menu` VALUES ('55', '1', '20');

-- ----------------------------
        -- Table structure for department
-- ----------------------------
    DROP TABLE IF EXISTS `department`;
    CREATE TABLE `department` (
            `deptno` int(11) NOT NULL AUTO_INCREMENT COMMENT '部门编号',
            `dname` varchar(10) NOT NULL COMMENT '部门名称',
            `loc` varchar(10) NOT NULL COMMENT '部门地址',
    PRIMARY KEY (`deptno`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8 ROW_FORMAT=COMPACT;

-- ----------------------------
        -- Records of department
-- ----------------------------
    INSERT INTO `department` VALUES ('1', '管理部门', '脱单大厦52层');

-- ----------------------------
        -- Table structure for empaccount
-- ----------------------------
    DROP TABLE IF EXISTS `empaccount`;
    CREATE TABLE `empaccount` (
            `empno` int(11) DEFAULT NULL COMMENT '员工编号',
            `password` varchar(20) DEFAULT NULL COMMENT '密码',
    KEY `fk_employee_id` (`empno`) USING BTREE,
    CONSTRAINT `fk_employee_id` FOREIGN KEY (`empno`) REFERENCES `employee` (`empno`)
            ) ENGINE=InnoDB DEFAULT CHARSET=utf8 ROW_FORMAT=COMPACT;

-- ----------------------------
        -- Records of empaccount
-- ----------------------------
    INSERT INTO `empaccount` VALUES ('1', '1');
    INSERT INTO `empaccount` VALUES ('2', '2');
    INSERT INTO `empaccount` VALUES ('3', '3');
    INSERT INTO `empaccount` VALUES ('4', '4');
    INSERT INTO `empaccount` VALUES ('5', '5');
    INSERT INTO `empaccount` VALUES ('6', '6');

-- ----------------------------
        -- Table structure for employee
-- ----------------------------
    DROP TABLE IF EXISTS `employee`;
    CREATE TABLE `employee` (
            `empno` int(11) NOT NULL AUTO_INCREMENT COMMENT '员工ID',
            `ename` varchar(10) NOT NULL COMMENT '员工姓名',
            `sex` enum('男','女') NOT NULL COMMENT '性别',
            `idcard` varchar(255) NOT NULL COMMENT '身份证号',
            `phone` varchar(11) NOT NULL,
  `hiredate` date NOT NULL COMMENT '入职日期',
            `mgr` int(11) DEFAULT NULL COMMENT '上司',
            `sal` double(10,2) NOT NULL COMMENT '工资',
            `comm` double(10,2) DEFAULT NULL COMMENT '奖金',
            `deptno` int(11) NOT NULL COMMENT '部门编号',
    PRIMARY KEY (`empno`) USING BTREE,
    UNIQUE KEY `ename` (`ename`) USING BTREE,
    KEY `fk_department_id` (`deptno`) USING BTREE,
    CONSTRAINT `fk_department_id` FOREIGN KEY (`deptno`) REFERENCES `department` (`deptno`)
            ) ENGINE=InnoDB AUTO_INCREMENT=7 DEFAULT CHARSET=utf8;

-- ----------------------------
        -- Records of employee
-- ----------------------------
    INSERT INTO `employee` VALUES ('1', '王事成', '男', '123456789012345678', '15166123451', '2021-05-01', null, '11000.00', '1500.00', '1');
    INSERT INTO `employee` VALUES ('2', '王聪云', '女', '123456789012345678', '15166123451', '2021-05-28', '1', '9000.00', '1000.00', '1');
    INSERT INTO `employee` VALUES ('3', '王東阳', '男', '123456789012345678', '15166123451', '2021-05-10', '1', '9000.00', '1000.00', '1');
    INSERT INTO `employee` VALUES ('4', '王盈盈', '女', '123456789012345678', '15166123451', '2021-05-21', '1', '9000.00', '1000.00', '1');
    INSERT INTO `employee` VALUES ('5', ' 王卉', '女', '123456789012345678', '12345687990', '2021-06-04', '1', '1221.00', '122.00', '1');
    INSERT INTO `employee` VALUES ('6', '王帅', '男', '123456789012345678', '123456789', '2021-06-04', '1', '1221.00', '212.00', '1');

-- ----------------------------
        -- Table structure for indent
-- ----------------------------
    DROP TABLE IF EXISTS `indent`;
    CREATE TABLE `indent` (
            `iid` int(11) NOT NULL AUTO_INCREMENT COMMENT '订单编号',
            `initiator` int(255) NOT NULL COMMENT '发起人编号',
            `cname` varchar(255) NOT NULL COMMENT '商品名称',
            `tid` int(11) NOT NULL COMMENT '商品类型id',
            `mid` int(11) DEFAULT NULL COMMENT '计量单位编号',
            `price` decimal(10,2) DEFAULT NULL COMMENT '价格',
            `num` int(11) NOT NULL COMMENT '所需数量',
            `fact` int(11) DEFAULT '0' COMMENT '实际收货数量',
            `staid` int(11) NOT NULL COMMENT '状态编号',
            `sid` int(11) NOT NULL COMMENT '供应商编号',
            `rank` int(11) DEFAULT '0' COMMENT '订单等级',
    PRIMARY KEY (`iid`),
    KEY `fk_commodity_cid` (`cname`),
    KEY `fa_measurement_mid` (`mid`),
    KEY `fa_emp_initiator` (`initiator`),
    KEY `fk_state_staid` (`staid`),
    KEY `fk_suppiler_sid` (`sid`),
    KEY `fk_classify_tid` (`tid`),
    CONSTRAINT `fa_emp_initiator` FOREIGN KEY (`initiator`) REFERENCES `employee` (`empno`),
    CONSTRAINT `fa_measurement_mid` FOREIGN KEY (`mid`) REFERENCES `measurement` (`mid`) ON DELETE CASCADE ON UPDATE CASCADE,
    CONSTRAINT `fk_classify_tid` FOREIGN KEY (`tid`) REFERENCES `classify` (`tid`) ON UPDATE CASCADE,
    CONSTRAINT `fk_state_staid` FOREIGN KEY (`staid`) REFERENCES `state` (`staid`) ON DELETE NO ACTION,
    CONSTRAINT `fk_suppiler_sid` FOREIGN KEY (`sid`) REFERENCES `suppiler` (`sid`) ON DELETE NO ACTION ON UPDATE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=15 DEFAULT CHARSET=utf8;

-- ----------------------------
        -- Records of indent
-- ----------------------------
    INSERT INTO `indent` VALUES ('1', '1', '可口可乐', '4', '7', '46.80', '1000', '1000', '12', '1', '4');
    INSERT INTO `indent` VALUES ('2', '1', '可口可乐', '4', '7', '46.80', '100', '99', '13', '1', '4');
    INSERT INTO `indent` VALUES ('4', '1', '花生牛轧糖', '1', '9', '9.50', '100', '100', '15', '1', '4');
    INSERT INTO `indent` VALUES ('5', '1', '名创冰泉', '4', '10', '30.00', '100', '100', '16', '1', '4');
    INSERT INTO `indent` VALUES ('6', '1', '名创冰泉', '4', '10', '30.00', '100', '100', '17', '1', '4');
    INSERT INTO `indent` VALUES ('7', '1', '纳诺儿童牙膏牙刷套装', '2', '11', '3.90', '2000', '2000', '18', '1', '4');
    INSERT INTO `indent` VALUES ('8', '1', '刮刮乐拖把', '3', '12', '18.00', '160', '160', '19', '1', '4');
    INSERT INTO `indent` VALUES ('9', '1', '花生牛轧糖', '1', '9', '9.50', '100', '100', '20', '1', '4');
    INSERT INTO `indent` VALUES ('10', '1', '方便面', '1', '13', '20.00', '100', '99', '21', '1', '4');
    INSERT INTO `indent` VALUES ('11', '1', '方便面', '1', '13', '20.00', '100', '100', '22', '1', '4');
    INSERT INTO `indent` VALUES ('12', '1', '老坛酸菜牛肉面', '1', '14', '40.00', '99', '99', '23', '1', '4');
    INSERT INTO `indent` VALUES ('13', '1', '巧克力', '1', '15', '30.00', '100', '99', '24', '1', '4');
    INSERT INTO `indent` VALUES ('14', '1', '方便面', '1', '13', '20.00', '100', '100', '25', '1', '4');

-- ----------------------------
        -- Table structure for measurement
-- ----------------------------
    DROP TABLE IF EXISTS `measurement`;
    CREATE TABLE `measurement` (
            `mid` int(11) NOT NULL AUTO_INCREMENT COMMENT '计量编号',
            `mbig` varchar(50) DEFAULT NULL COMMENT '计量单位(大)',
            `scale` int(11) DEFAULT NULL COMMENT '换算比例',
            `mlittle` varchar(50) DEFAULT NULL COMMENT '计量单位(小)',
    PRIMARY KEY (`mid`)
) ENGINE=InnoDB AUTO_INCREMENT=16 DEFAULT CHARSET=utf8;

-- ----------------------------
        -- Records of measurement
-- ----------------------------
    INSERT INTO `measurement` VALUES ('7', '箱', '12', '瓶');
    INSERT INTO `measurement` VALUES ('9', '包', '500', 'g');
    INSERT INTO `measurement` VALUES ('10', '箱', '10', '瓶');
    INSERT INTO `measurement` VALUES ('11', '盒', '1', '盒');
    INSERT INTO `measurement` VALUES ('12', '件', '1', '件');
    INSERT INTO `measurement` VALUES ('13', '箱', '30', '包');
    INSERT INTO `measurement` VALUES ('14', '箱', '10', '桶');
    INSERT INTO `measurement` VALUES ('15', '箱', '20', '盒');

-- ----------------------------
        -- Table structure for sell
-- ----------------------------
    DROP TABLE IF EXISTS `sell`;
    CREATE TABLE `sell` (
            `sid` int(11) NOT NULL AUTO_INCREMENT COMMENT '货品编号',
            `cid` int(11) DEFAULT NULL COMMENT '商品编号',
            `sprice` decimal(65,2) NOT NULL COMMENT '售价',
            `snum` double(11,2) DEFAULT NULL COMMENT '数量',
    PRIMARY KEY (`sid`),
    KEY `fk_comm_cid` (`cid`),
    CONSTRAINT `fk_comm_cid` FOREIGN KEY (`cid`) REFERENCES `commodity` (`cid`)
            ) ENGINE=InnoDB AUTO_INCREMENT=9 DEFAULT CHARSET=utf8;

-- ----------------------------
        -- Records of sell
-- ----------------------------
    INSERT INTO `sell` VALUES ('1', '1', '4.00', '19068.00');
    INSERT INTO `sell` VALUES ('2', '2', '0.50', '99500.00');
    INSERT INTO `sell` VALUES ('3', '3', '4.00', '1989.00');
    INSERT INTO `sell` VALUES ('4', '4', '5.00', '1994.00');
    INSERT INTO `sell` VALUES ('5', '5', '19.99', '159.00');
    INSERT INTO `sell` VALUES ('6', '6', '3.00', '8938.00');
    INSERT INTO `sell` VALUES ('7', '7', '5.00', '990.00');
    INSERT INTO `sell` VALUES ('8', '8', '3.00', '1980.00');

-- ----------------------------
        -- Table structure for state
-- ----------------------------
    DROP TABLE IF EXISTS `state`;
    CREATE TABLE `state` (
            `staid` int(11) NOT NULL AUTO_INCREMENT COMMENT '状态编号',
            `manager` int(11) NOT NULL DEFAULT '0' COMMENT '采购经理审批状态0：待审批，1：同意',
            `payment` int(11) NOT NULL DEFAULT '0' COMMENT '付款状态0：待审批，1：同意购买，2：付款成功',
            `deliveryTime` date DEFAULT NULL COMMENT '交货期限',
            `receive` int(11) NOT NULL DEFAULT '0' COMMENT '0:未接受，1：已接收',
            `verify` int(11) DEFAULT NULL COMMENT '核对人员',
            `end` int(11) NOT NULL DEFAULT '0',
            `endTime` date DEFAULT NULL COMMENT '入库时间',
    PRIMARY KEY (`staid`)
) ENGINE=InnoDB AUTO_INCREMENT=26 DEFAULT CHARSET=utf8;

-- ----------------------------
        -- Records of state
-- ----------------------------
    INSERT INTO `state` VALUES ('12', '1', '2', '2021-06-16', '1', '1', '1', '2021-06-16');
    INSERT INTO `state` VALUES ('13', '1', '2', '2021-06-16', '1', '1', '1', '2021-06-16');
    INSERT INTO `state` VALUES ('15', '1', '2', '2021-06-17', '1', '1', '1', '2021-06-16');
    INSERT INTO `state` VALUES ('16', '1', '2', '2021-06-16', '1', '1', '1', '2021-06-17');
    INSERT INTO `state` VALUES ('17', '1', '2', '2021-06-19', '1', '1', '1', '2021-06-18');
    INSERT INTO `state` VALUES ('18', '1', '2', '2021-06-18', '1', '1', '1', '2021-06-18');
    INSERT INTO `state` VALUES ('19', '1', '2', '2021-06-18', '1', '1', '1', '2021-06-18');
    INSERT INTO `state` VALUES ('20', '1', '2', '2021-06-19', '1', '1', '1', '2021-06-19');
    INSERT INTO `state` VALUES ('21', '1', '2', '2021-06-18', '1', '1', '1', '2021-06-18');
    INSERT INTO `state` VALUES ('22', '1', '2', '2021-06-18', '1', '1', '1', '2021-06-18');
    INSERT INTO `state` VALUES ('23', '1', '2', '2021-06-18', '1', '1', '1', '2021-06-18');
    INSERT INTO `state` VALUES ('24', '1', '2', '2021-06-18', '1', '1', '1', '2021-06-18');
    INSERT INTO `state` VALUES ('25', '1', '2', '2021-06-18', '1', '1', '1', '2021-06-18');

-- ----------------------------
        -- Table structure for suppiler
-- ----------------------------
    DROP TABLE IF EXISTS `suppiler`;
    CREATE TABLE `suppiler` (
            `sid` int(11) NOT NULL AUTO_INCREMENT COMMENT '供应商编号',
            `firm` varchar(20) NOT NULL COMMENT '公司地址',
            `province` varchar(30) NOT NULL COMMENT '省级地址',
            `city` varchar(255) DEFAULT NULL COMMENT '''市级地区''',
            `county` varchar(255) DEFAULT NULL COMMENT '''县级地区''',
            `sname` varchar(10) NOT NULL COMMENT '供货负责人',
            `phone` varchar(11) NOT NULL COMMENT '负责人电话',
            `scope` varchar(255) NOT NULL COMMENT '''主营范围''',
    PRIMARY KEY (`sid`) USING BTREE,
    UNIQUE KEY `firm` (`firm`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8 ROW_FORMAT=COMPACT;

-- ----------------------------
        -- Records of suppiler
-- ----------------------------
    INSERT INTO `suppiler` VALUES ('1', '万能公司', '河北省', '石家庄市', '裕华区', '张百忍', '1423567', '要啥有啥');

-- ----------------------------
        -- Table structure for vip
-- ----------------------------
    DROP TABLE IF EXISTS `vip`;
    CREATE TABLE `vip` (
            `vid` int(11) NOT NULL AUTO_INCREMENT COMMENT '会员id',
            `vname` varchar(20) NOT NULL COMMENT '姓名',
            `sex` char(2) DEFAULT '男',
            `idcard` varchar(255) NOT NULL COMMENT '身份证号',
            `phone` varchar(255) NOT NULL COMMENT '联系方式',
    PRIMARY KEY (`vid`)
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8;

-- ----------------------------
        -- Records of vip
-- ----------------------------
    INSERT INTO `vip` VALUES ('1', '吕祖龙', '男', '123456789012345678', '12345678901');
    INSERT INTO `vip` VALUES ('2', '张堯', '女', '123456789012345678', '12345678902');
    INSERT INTO `vip` VALUES ('3', '张堯', '男', '124365789012345678', '12345678903');

-- ----------------------------
        -- Table structure for vipaccount
-- ----------------------------
    DROP TABLE IF EXISTS `vipaccount`;
    CREATE TABLE `vipaccount` (
            `vid` int(11) NOT NULL AUTO_INCREMENT COMMENT '会员id',
            `password` varchar(20) NOT NULL COMMENT '密码',
            `integral` int(11) NOT NULL DEFAULT '0' COMMENT '积分',
            `grade` varchar(20) DEFAULT '青铜会员' COMMENT '等级',
    KEY `fk_vid` (`vid`),
    CONSTRAINT `fk_vid` FOREIGN KEY (`vid`) REFERENCES `vip` (`vid`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8;

-- ----------------------------
        -- Records of vipaccount
-- ----------------------------
    INSERT INTO `vipaccount` VALUES ('1', '1', '319', '白银会员');
    INSERT INTO `vipaccount` VALUES ('2', '2', '790', '黄金会员');
    INSERT INTO `vipaccount` VALUES ('3', '3', '111', '青铜会员');
*/
}
